package com.oocl.im.action.impl;


import com.oocl.im.action.IAction;
import com.oocl.im.entity.Protocol;

import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;

import com.oocl.im.outputstream.NetOutput;
import com.oocl.im.constants.Constants;
import com.oocl.im.handle.IHandle;

public class LoginAction implements IAction {
	String account;
	ObjectOutputStream oos;
	
	
	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public LoginAction(ObjectOutputStream oos) {
		super();
		this.oos = oos;
	}
	
	public LoginAction(){
		
	}

	public void execute(Protocol protocol) {

		NetOutput netOutput = new NetOutput(oos);
		Map<String, Object> params =  new HashMap<String, Object>();
		params.put(Constants.FROM,account);
		
		protocol = new Protocol(Constants.LOGIN, params);

		
		netOutput.write(protocol);
		
		
	}
	
	

}
